package situ.com.androidstudy;

import android.app.AlertDialog;
import android.support.v4.view.ViewCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {
    private static final String TAG = "MainActivity";
    private Button btn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        btn = (Button) findViewById(R.id.btn);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                System.out.println("click");
                Log.d(TAG, "debug");
                Log.i(TAG, "info");
                Log.w(TAG, "warn");
                Log.e(TAG, "error");

                new AlertDialog.Builder(MainActivity.this)
                        .setTitle("请添加兴趣爱好！")
                        .setIcon(R.mipmap.ic_launcher)
                        .setMultiChoiceItems(new String[]{"旅游", "美食", "汽车", "宠物"},
                                null,
                                null)
                        .setPositiveButton("确定", null)
                        .show();
            }
        });

    }
}
